.class public Lcom/bitauto/autoeasy/selectcar/Object/DealerParser;
.super Ljava/lang/Object;
.source "DealerParser.java"


# static fields
.field private static final CALLCENTERNUMBER:Ljava/lang/String; = "CallCenterNumber"

.field private static final VENDORBIZMODE:Ljava/lang/String; = "VendorBizMode"

.field private static final VENDORFULLNAME:Ljava/lang/String; = "vendorFullName"

.field private static final VENDORID:Ljava/lang/String; = "vendorID"

.field private static final VENDORNAME:Ljava/lang/String; = "vendorName"

.field private static final VENDORSALEADDR:Ljava/lang/String; = "vendorSaleAddr"

.field private static final VENDORSITE:Ljava/lang/String; = "Vendorsite"

.field private static final VENDORTEL:Ljava/lang/String; = "vendorTel"

.field private static final fourS:Ljava/lang/String; = "4S\u5e97"

.field private static final zonghe:Ljava/lang/String; = "\u7efc\u5408\u5e97"


# instance fields
.field private TAG:Ljava/lang/String;

.field private fourList:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList",
            "<",
            "Lcom/bitauto/autoeasy/selectcar/Object/Dealer;",
            ">;"
        }
    .end annotation
.end field

.field private url:Ljava/lang/String;

.field private zongheList:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList",
            "<",
            "Lcom/bitauto/autoeasy/selectcar/Object/Dealer;",
            ">;"
        }
    .end annotation
.end field


# direct methods
.method public constructor <init>(Ljava/lang/String;)V
    .locals 1
    .parameter "url"

    .prologue
    .line 46
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 43
    const-string v0, ""

    iput-object v0, p0, Lcom/bitauto/autoeasy/selectcar/Object/DealerParser;->url:Ljava/lang/String;

    .line 44
    const-string v0, "DealerParser"

    iput-object v0, p0, Lcom/bitauto/autoeasy/selectcar/Object/DealerParser;->TAG:Ljava/lang/String;

    .line 47
    iput-object p1, p0, Lcom/bitauto/autoeasy/selectcar/Object/DealerParser;->url:Ljava/lang/String;

    .line 48
    return-void
.end method


# virtual methods
.method public Paser2Object()V
    .locals 9

    .prologue
    const/4 v8, 0x0

    .line 53
    :try_start_0
    new-instance v5, Ljava/util/ArrayList;

    invoke-direct {v5}, Ljava/util/ArrayList;-><init>()V

    iput-object v5, p0, Lcom/bitauto/autoeasy/selectcar/Object/DealerParser;->fourList:Ljava/util/ArrayList;

    .line 54
    new-instance v5, Ljava/util/ArrayList;

    invoke-direct {v5}, Ljava/util/ArrayList;-><init>()V

    iput-object v5, p0, Lcom/bitauto/autoeasy/selectcar/Object/DealerParser;->zongheList:Ljava/util/ArrayList;

    .line 56
    iget-object v5, p0, Lcom/bitauto/autoeasy/selectcar/Object/DealerParser;->url:Ljava/lang/String;

    invoke-static {v5}, Lcom/bitauto/autoeasy/tool/Caller;->doGet(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v4

    .line 57
    .local v4, str:Ljava/lang/String;
    if-eqz v4, :cond_0

    .line 58
    new-instance v3, Lorg/json/JSONArray;

    invoke-direct {v3, v4}, Lorg/json/JSONArray;-><init>(Ljava/lang/String;)V

    .line 60
    .local v3, jObj:Lorg/json/JSONArray;
    invoke-virtual {v3}, Lorg/json/JSONArray;->length()I

    move-result v5

    if-lez v5, :cond_0

    .line 61
    const/4 v2, 0x0

    .local v2, i:I
    :goto_0
    invoke-virtual {v3}, Lorg/json/JSONArray;->length()I

    move-result v5

    if-lt v2, v5, :cond_1

    .line 83
    .end local v2           #i:I
    .end local v3           #jObj:Lorg/json/JSONArray;
    .end local v4           #str:Ljava/lang/String;
    :cond_0
    :goto_1
    return-void

    .line 62
    .restart local v2       #i:I
    .restart local v3       #jObj:Lorg/json/JSONArray;
    .restart local v4       #str:Ljava/lang/String;
    :cond_1
    invoke-virtual {v3, v2}, Lorg/json/JSONArray;->getJSONObject(I)Lorg/json/JSONObject;

    move-result-object v5

    invoke-virtual {p0, v5}, Lcom/bitauto/autoeasy/selectcar/Object/DealerParser;->createDealer(Lorg/json/JSONObject;)Lcom/bitauto/autoeasy/selectcar/Object/Dealer;

    move-result-object v0

    .line 63
    .local v0, dea:Lcom/bitauto/autoeasy/selectcar/Object/Dealer;
    const-string v5, "4S\u5e97"

    invoke-virtual {v0}, Lcom/bitauto/autoeasy/selectcar/Object/Dealer;->getVendorBizMode()Ljava/lang/String;

    move-result-object v6

    invoke-virtual {v5, v6}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v5

    if-eqz v5, :cond_2

    .line 64
    iget-object v5, p0, Lcom/bitauto/autoeasy/selectcar/Object/DealerParser;->fourList:Ljava/util/ArrayList;

    invoke-virtual {v5, v0}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 61
    :goto_2
    add-int/lit8 v2, v2, 0x1

    goto :goto_0

    .line 65
    :cond_2
    const-string v5, "\u7efc\u5408\u5e97"

    invoke-virtual {v0}, Lcom/bitauto/autoeasy/selectcar/Object/Dealer;->getVendorBizMode()Ljava/lang/String;

    move-result-object v6

    invoke-virtual {v5, v6}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v5

    if-eqz v5, :cond_3

    .line 66
    iget-object v5, p0, Lcom/bitauto/autoeasy/selectcar/Object/DealerParser;->zongheList:Ljava/util/ArrayList;

    invoke-virtual {v5, v0}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
    :try_end_0
    .catch Lorg/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0
    .catch Lcom/bitauto/autoeasy/tool/WSError; {:try_start_0 .. :try_end_0} :catch_1

    goto :goto_2

    .line 74
    .end local v0           #dea:Lcom/bitauto/autoeasy/selectcar/Object/Dealer;
    .end local v2           #i:I
    .end local v3           #jObj:Lorg/json/JSONArray;
    .end local v4           #str:Ljava/lang/String;
    :catch_0
    move-exception v5

    move-object v1, v5

    .line 75
    .local v1, e:Lorg/json/JSONException;
    iget-object v5, p0, Lcom/bitauto/autoeasy/selectcar/Object/DealerParser;->TAG:Ljava/lang/String;

    new-instance v6, Ljava/lang/StringBuilder;

    const-string v7, "error :"

    invoke-direct {v6, v7}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v1}, Lorg/json/JSONException;->toString()Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    invoke-static {v5, v6}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    .line 76
    iput-object v8, p0, Lcom/bitauto/autoeasy/selectcar/Object/DealerParser;->fourList:Ljava/util/ArrayList;

    .line 77
    iput-object v8, p0, Lcom/bitauto/autoeasy/selectcar/Object/DealerParser;->zongheList:Ljava/util/ArrayList;

    .line 78
    invoke-virtual {v1}, Lorg/json/JSONException;->printStackTrace()V

    goto :goto_1

    .line 68
    .end local v1           #e:Lorg/json/JSONException;
    .restart local v0       #dea:Lcom/bitauto/autoeasy/selectcar/Object/Dealer;
    .restart local v2       #i:I
    .restart local v3       #jObj:Lorg/json/JSONArray;
    .restart local v4       #str:Ljava/lang/String;
    :cond_3
    :try_start_1
    iget-object v5, p0, Lcom/bitauto/autoeasy/selectcar/Object/DealerParser;->zongheList:Ljava/util/ArrayList;

    invoke-virtual {v5, v0}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
    :try_end_1
    .catch Lorg/json/JSONException; {:try_start_1 .. :try_end_1} :catch_0
    .catch Lcom/bitauto/autoeasy/tool/WSError; {:try_start_1 .. :try_end_1} :catch_1

    goto :goto_2

    .line 79
    .end local v0           #dea:Lcom/bitauto/autoeasy/selectcar/Object/Dealer;
    .end local v2           #i:I
    .end local v3           #jObj:Lorg/json/JSONArray;
    .end local v4           #str:Ljava/lang/String;
    :catch_1
    move-exception v5

    move-object v1, v5

    .line 81
    .local v1, e:Lcom/bitauto/autoeasy/tool/WSError;
    invoke-virtual {v1}, Lcom/bitauto/autoeasy/tool/WSError;->printStackTrace()V

    goto :goto_1
.end method

.method public createDealer(Lorg/json/JSONObject;)Lcom/bitauto/autoeasy/selectcar/Object/Dealer;
    .locals 5
    .parameter "obj"

    .prologue
    .line 101
    new-instance v0, Lcom/bitauto/autoeasy/selectcar/Object/Dealer;

    invoke-direct {v0}, Lcom/bitauto/autoeasy/selectcar/Object/Dealer;-><init>()V

    .line 103
    .local v0, dealer:Lcom/bitauto/autoeasy/selectcar/Object/Dealer;
    :try_start_0
    const-string v2, "CallCenterNumber"

    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2}, Lcom/bitauto/autoeasy/selectcar/Object/Dealer;->setCallCenterNumber(Ljava/lang/String;)V

    .line 104
    const-string v2, "VendorBizMode"

    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2}, Lcom/bitauto/autoeasy/selectcar/Object/Dealer;->setVendorBizMode(Ljava/lang/String;)V

    .line 105
    const-string v2, "vendorFullName"

    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2}, Lcom/bitauto/autoeasy/selectcar/Object/Dealer;->setVendorFullName(Ljava/lang/String;)V

    .line 106
    const-string v2, "vendorID"

    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2}, Lcom/bitauto/autoeasy/selectcar/Object/Dealer;->setVendorID(Ljava/lang/String;)V

    .line 107
    const-string v2, "vendorName"

    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2}, Lcom/bitauto/autoeasy/selectcar/Object/Dealer;->setVendorName(Ljava/lang/String;)V

    .line 108
    const-string v2, "vendorSaleAddr"

    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2}, Lcom/bitauto/autoeasy/selectcar/Object/Dealer;->setVendorSaleAddr(Ljava/lang/String;)V

    .line 109
    const-string v2, "Vendorsite"

    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2}, Lcom/bitauto/autoeasy/selectcar/Object/Dealer;->setVendorsite(Ljava/lang/String;)V

    .line 110
    const-string v2, "vendorTel"

    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2}, Lcom/bitauto/autoeasy/selectcar/Object/Dealer;->setVendorTel(Ljava/lang/String;)V
    :try_end_0
    .catch Lorg/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0

    move-object v2, v0

    .line 115
    :goto_0
    return-object v2

    .line 112
    :catch_0
    move-exception v2

    move-object v1, v2

    .line 113
    .local v1, e:Lorg/json/JSONException;
    const-string v2, "BrandParser"

    new-instance v3, Ljava/lang/StringBuilder;

    const-string v4, "error :"

    invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v1}, Lorg/json/JSONException;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-static {v2, v3}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    .line 114
    invoke-virtual {v1}, Lorg/json/JSONException;->printStackTrace()V

    .line 115
    const/4 v2, 0x0

    goto :goto_0
.end method

.method public getFourList()Ljava/util/ArrayList;
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/ArrayList",
            "<",
            "Lcom/bitauto/autoeasy/selectcar/Object/Dealer;",
            ">;"
        }
    .end annotation

    .prologue
    .line 86
    iget-object v0, p0, Lcom/bitauto/autoeasy/selectcar/Object/DealerParser;->fourList:Ljava/util/ArrayList;

    return-object v0
.end method

.method public getZongheList()Ljava/util/ArrayList;
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/ArrayList",
            "<",
            "Lcom/bitauto/autoeasy/selectcar/Object/Dealer;",
            ">;"
        }
    .end annotation

    .prologue
    .line 91
    iget-object v0, p0, Lcom/bitauto/autoeasy/selectcar/Object/DealerParser;->zongheList:Ljava/util/ArrayList;

    return-object v0
.end method
